<template>
    <div  style="margin-top:30px ;" >
        <van-swipe :width="300" :height="200"  :autoplay="3000">
        <van-swipe-item v-for="(image, index) in images" :key="index">
            <img  v-lazy="image"  />
        </van-swipe-item>
        </van-swipe>
    </div>
</template>

<script>
    import    { getlunbo }  from '@api/home.js'
    export default {
        name:"Swiper",
        data() {
    return {
      images: [
        'https://img01.yzcdn.cn/vant/apple-1.jpg',
        'https://img01.yzcdn.cn/vant/apple-2.jpg',
      ],
    };
  },

   async created(){
       let result =  await  getlunbo()
       console.log(result);
       this.images = result.data.map( v=>  v.img)
   }
    }
</script>

<style lang="scss" scoped>

.van-swipe__track img{ 
    width: 100%;
}
</style>